﻿<%@page import="com.hh.bss.util.StringHelper" %>
<%
  String id=request.getParameter("id");
  String cvId=request.getParameter("cvId");  
  String type=request.getParameter("type");  
  if (StringHelper.isEmpty(id)) id="0";
  if (StringHelper.isEmpty(cvId)) cvId="0";
  
%>   

	
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="职位候选人推荐">  
    <meta name="description" content="职位候选人推荐">  
    <title>职位候选人推荐信息</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>
    <script type="text/javascript" src="/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript" src="/js/tiny.js"></script>  
</head>  
<script type="text/javascript">  

   var cvId=<%=cvId%>;
   var id=<%=id%>;
   
            
</script> 
<body>  
    
      
    <div class="easyui-panel"  style="height:600px"> 
    	
        <form id="fm" method="post" enctype="multipart/form-data" novalidate>  
        	  	  	 <input type="hidden" name="id" > 
        	  	  	 <input type="hidden" name="jobId" >
        	  	  	 <input type="hidden" name="cvId" > 
        	  	  	 <table>
        	  	  	 	<tr>
        	  	  	 		 <td>职位<font color="red">*</font>:</td>
        	  	  	 		 <td><input name="jobName" class="easyui-box"   required="true"><a href="#" class="easyui-linkbutton" onclick="javascript:selectJob()">选择</a></td>
        	  	  	 	</tr>
        	  	  	 	<tr>
        	  	  	 		 <td>优势:</td>
        	  	  	 		 <td><textarea id="elm1" name="recomResult" style="width:600px;height:150px"></textarea></td>
        	  	  	 	</tr>
        	  	  	 	<tr>
        	  	  	 		 <td>劣势:</td>
        	  	  	 		 <td><textarea  id="elm2" name="recomRisk" style="width:600px;height:150px"></textarea></td>
        	  	  	 	</tr>
        	  	  	 	<tr>
        	  	  	 		 <td>总结:</td>
        	  	  	 		 <td><textarea  id="elm3" name="summary" style="width:600px;height:150px"></textarea></td>
        	  	  	 	</tr>
        	  	  	 	
        	  	  	</table>
        	  	  	 
        	  	  	 
	        		     
        </form>  
        <div  style="text-align:center">  
          <a href="javascript:void(0)" id="btn-save" class="easyui-linkbutton" iconCls="icon-ok" onclick="javascript:save()" >保存</a>  
          <a href="javascript:void(0)" id="btn-close" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:closeWin()">关闭</a>  
        </div>
       
    </div>  
    <!-- edit form窗体（结束） -->  
    
    
    <script type="text/javascript">  
        var url;  
        var selectJobWin;
        var cvId=<%=cvId%>; 
        var url='/project/contractJobCvRecom/save.do';
        <%if ("UPDATE".equals(type)){ %>
            url='/project/contractJobCvRecom/update.do';
        <% }%>
        
        function save(){          	   
        	  if (!$('#fm').form('validate')) return; 
             $('#fm').form('submit',{  
                url: url,  
                onSubmit: function(){  
                	  
                    return $(this).form('validate');  
                },  
                success: function(result){  
                    var result = eval('('+result+')');  
                    console.log(result);
                    if (result.success == true){  
                        //$.messager.alert('信息',result.msg,'info');  
                        alert(result.msg);
                        if (refresh) refresh();
                        if (closeWin) closeWin();
                        //$('#dlg').dialog('close');     
                        
                        //$('#dg').datagrid('reload'); 
                    } else {  
                        $.messager.alert('错误',result.msg,'error');
                    }  
                }  
            });   
        }  
       function setJob(job){
                          $('#fm input[name="jobName"]').attr("value",job.name);
                          $('#fm input[name="jobId"]').attr("value",job.id);
                          
       }
        
        function selectJob(){
        	           if (selectJobWin)
                            selectJobWin.window('open');
                        else selectJobWin = $.window({
		                 	   	title:"选择职位",
		                 	   	url:"/project/contractJob/selectJobPage.do",
		                 	   	isIframe:true,
		                 	   	height:400,
		                 	   	modal:true,		      	   	
		                 	   	width:1000,
		                 	   	onComplete:function(jq,iframe){	
		                 	   		         	   		   	      	   		
		                 	   		   var fwindow = $.window.util.getFrameWindow(iframe);		      	   		
		                 	   		   var ijq = fwindow.jQuery;		
		                 	   		   var curWin=this;   
		                 	   		   
		                 	   		   var curWin=this;
					           
					                      fwindow.closeWin=function(){
					                      	   curWin.window('close');
					                      	  
				                        };
				                        
				                        fwindow.callback=curWin.openerWin.setJob;
				                        //fwindow.pcallback=curWin.openerWin.addCompanyDB;
		                 	   		   //alert(fwindow.pcallback2);
		                 	   	}
		                 	});
		                 	selectJobWin.openerWin=window;  
                  }
        
    </script>  
     
     

     
     
     
</body>  
</html>
<script>
	  $('#fm').find('input[name="cvId"]').attr("value",cvId);
	  
	      <%if ("UPDATE".equals(type)){ %>
            $('#fm').form('load','/project/contractJobCvRecom/get.do?id='+id);
        <% }%>
  
</script>